package com.hss.rxjava.bean;

import com.hss.rxjava.CheckInterface;
import com.hss.rxjava.StringUtils;

public class MessageInfo implements CheckInterface {
	private String messageId;
	private String messageTime;
	private String typeName;
	private int type;
	private String content;

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	public void setMessageTime(String messageTime) {
		this.messageTime = messageTime;
	}

	public String getMessageTime() {
		return messageTime;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getType() {
		return type;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getContent() {
		return content;
	}

	@Override
	public boolean check(int index) {
		if(!StringUtils.isNotNull(messageTime,typeName,content))return false;
		if(!StringUtils.isValidate(messageId))return false;
		return true;
	}

	@Override
	public void fix(int index) {
		messageTime = StringUtils.makeStringNotNull(messageTime);
		typeName = StringUtils.makeStringNotNull(typeName,"消息类型:" + type);
		content = StringUtils.makeStringNotNull(content);
	}
}
